module.exports = app => {
    const { STRING, INTEGER, TEXT, DECIMAL, DATE, BOOLEAN } = app.Sequelize;
  
    const SupplierInfo = app.model.define('supplier_info', {
      sid: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment: '主键ID'
      },
      stt: {
        type: STRING(20),
        comment: '序号'
      },
      supplier_code: {
        type: STRING(50),
        allowNull: false,
        comment: '供应商代码'
      },
      supplier_name: {
        type: STRING(500),
        comment: '供应商名称'
      },
      tax_code: {
        type: STRING(100),
        comment: '税号'
      },
      supply_industry: {
        type: STRING(200),
        comment: '供应行业'
      },
      address: {
        type: TEXT,
        comment: '地址'
      },
      contact_person: {
        type: STRING(200),
        comment: '联系人'
      },
      contact_phone: {
        type: STRING(100),
        comment: '联系电话'
      },
      email: {
        type: STRING(200),
        comment: '邮箱'
      },
      website: {
        type: STRING(200),
        comment: '网站'
      },
      bank_account: {
        type: STRING(100),
        comment: '银行账号'
      },
      bank_name: {
        type: STRING(300),
        comment: '银行名称'
      },
      contract_code: {
        type: STRING(100),
        comment: '合同号'
      },
      contract_signing_date: {
        type: DATE,
        comment: '合同签订日期'
      },
      contract_term: {
        type: STRING(100),
        comment: '合同期限'
      },
      payment_terms: {
        type: STRING(200),
        comment: '付款条款'
      },
      debt_period: {
        type: STRING(100),
        comment: '账期'
      },
      contract_status: {
        type: STRING(100),
        comment: '合同状态'
      },
      supplier_status: {
        type: STRING(100),
        comment: '供应商状态'
      },
      additional_info1: {
        type: STRING(200),
        comment: '附加信息1'
      },
      additional_info2: {
        type: STRING(200),
        comment: '附加信息2'
      },
      additional_info3: {
        type: STRING(200),
        comment: '附加信息3'
      },
      create_time: {
        type: DATE,
        defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
        comment: '创建时间'
      },
      update_time: {
        type: DATE,
        defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
        comment: '更新时间'
      },
      modifier: {
        type: STRING(100),
        defaultValue: 'system',
        comment: '修改人'
      }
    }, {
      tableName: 'supplier_info',
      timestamps: false,
      comment: '供应商信息表'
    });
  
    return SupplierInfo;
  };